<jsp:useBean id="user" class="model.User" scope="session"></jsp:useBean>

<% user.setAccessed(true); %>

<html>

<head>
<title>Login korisnika</title>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1250">
<link rel="stylesheet" href="styles.css" />

<SCRIPT language="javascript">
<!--

	
	//validacija tekstutalnog polja
	function textValid(polje_1, polje_2) {

		if (polje_1.length == 0 || polje_2.length == 0) {
			window.alert("Prazno tekstutalno polje!\nPokusajte ponovo.");
			return false;
		}
		
		return true;
	}
//-->
</SCRIPT>

</head>


<body>
<%
	if (user.isAccessed() == false) {
		response.sendRedirect("index.html");
		return;
	}
%>


<h1>Logovanje postojeceg korisnika</h1>
<hr />
<p>
Da biste se logovali na sistem, unesite username.
</p>


<form name="forma" method="post" action="login.html" onSubmit="return textValid(document.forms['forma'].user.value, document.forms['forma'].pass.value)">

<table BORDER="2" cellspacing="2">

<tr>
<td bgcolor="#CCCCFF">Username:</td>
<td align="center">
<input id="userID" name="user" size="20"  TYPE="TEXT" style="float:left"></td>
</tr>
<tr>
<td bgcolor="#CCCCFF">Password:</td>
<td align="center">
<input name="pass" size="20"  TYPE="PASSWORD" style="float:left"></td>
</tr>

<tr align="center">
<td bgcolor="#CCCCCC">&nbsp;</td>
<td bgcolor="#CCCC99">
  <INPUT TYPE="submit" NAME="submit" VALUE="Login"></td>
</tr>
</table>

</form>

<b style="color: red">${error_message}</b>
<br /><br />

<a href="register.html">Register</a>
<br>
<a href="index.html">Home</a>

<jsp:include page="footer.jsp"></jsp:include>

</body>

</html>
